package hezhiqin.com.autoconfigtation;

import hezhiqin.com.format.FormatProcessor;

/**
 * @program: homeWork
 * @description:
 * @author: hezhiqin
 * @create: 2020-03-03 14:41
 */
public class HelloFormatTemplate {

    private FormatProcessor formatProcessor;

    private HelloProperties helloProperties;


    public HelloFormatTemplate(FormatProcessor formatProcessor, HelloProperties helloProperties) {
        this.formatProcessor = formatProcessor;
        this.helloProperties = helloProperties;
    }

    public <T> String  doFormat(T obj){
        StringBuilder stringBuilder = new StringBuilder();
        stringBuilder.append("Execute").append("\n");
        stringBuilder.append("begin:excute format").append("helloProperties").append(formatProcessor.formate(helloProperties.getInfo()));
        stringBuilder.append("Obj format result").append(formatProcessor.formate(obj)).append("\n");
        return stringBuilder.toString();
    }
}
